/*******************************************************************************
 * Copyright (c) 2008 Sylvain Sicard.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Sylvain Sicard - initial API and implementation
 ******************************************************************************/
package fr.jade.fraclite.adl.attributes;

import org.objectweb.fractal.adl.attributes.FractalAttributeBuilder;
import org.objectweb.fractal.api.Component;

import fr.jade.fraclite.api.control.GenericAttributeController;

/**
 * A Fractal based implementation of the AttributeBuilder interface. 
 * This builder replace the standard builder to provide a support 
 * for generic attribute controller.
 * @author nono
 * @contact noel.depalma@inrialpes.fr
 */
public class FractalGenericAttributeBuilder extends FractalAttributeBuilder {
	
	// --------------------------------------------------------------------------
	// Implementation of the AttributeBuilder interface
	// --------------------------------------------------------------------------
	
	public void setAttribute (final Object component, final String attributeController, final String name, final String value, final Object context) throws Exception {   
		GenericAttributeController gac = null;
		gac = (GenericAttributeController)(((Component)component).getFcInterface("generic-attribute-controller"));
		gac.setAttribute(name,value);
	}
}
